import { login as loginService } from '@/services/sessionService';

export default {
    namespace: 'session',
    state: {
        status : "anno",
        user : {}
    },
    effects: {
        *login({ params }, { call, put }) {
            const result = yield call(loginService, params);
            yield put({
                type: 'setStatus',
                status: "on",
                user: result.data
            });
        },
    },
    reducers: {
        setStatus(state, {status, user}) {
            return {...state, status, user};
        },
    },
};
